<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class OrderOutboundGoods extends Model
{
    protected $table = 'ims_yz_order_outbound_goods';
    public $timestamps = false;
    
    protected $fillable = [
        'uniacid',
        'outbound_id',
        'order_goods_id',
        'goods_id',
        'created_at',
        'updated_at'
    ];

    protected $casts = [
        'created_at' => 'integer',
        'updated_at' => 'integer'
    ];

    /**
     * 关联发货单
     */
    public function outbound()
    {
        return $this->belongsTo(OrderOutbound::class, 'outbound_id', 'id');
    }

    /**
     * 关联订单商品
     */
    public function orderGoods()
    {
        return $this->belongsTo(OrderGoods::class, 'order_goods_id', 'id');
    }

    /**
     * 关联商品
     */
    public function goods()
    {
        return $this->belongsTo(Goods::class, 'goods_id', 'id');
    }
}
